//
//  NoMissViewController.m
//  旅游咨询
//
//  Created by 高建 on 15/4/16.
//  Copyright (c) 2015年 xubin. All rights reserved.
//

#import "NoMissViewController.h"

@interface NoMissViewController ()

@end

@implementation NoMissViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationController.navigationBar.hidden = YES;
    
    self.view.backgroundColor = [UIColor redColor];
    
    self.webview = [[UIWebView alloc]initWithFrame:self.view.bounds];
    
    //设置代理人
    self.webview.delegate = self;
    [self.view addSubview:self.webview];
    
    //请求URL
    NSString *str = self.NoMissUrl;
    str = [str stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSURL *url = [NSURL URLWithString:str];
    NSMutableURLRequest *resquest = [NSMutableURLRequest requestWithURL:url cachePolicy:(NSURLRequestUseProtocolCachePolicy) timeoutInterval:60];
    //加载请求
    [self.webview loadRequest:resquest];
    [_webview release];
 

    UIButton *myButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [myButton addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.webview addSubview:myButton];
    myButton.frame = CGRectMake(14, 23, 23, 30);
    
    
    
    
    
    
}
- (void)buttonAction:(UIBarButtonItem *)missButton
{

    [self.navigationController popToViewController:self.MissVC animated:YES];
    self.navigationController.navigationBar.hidden = NO;
}


- (void)webViewDidStartLoad:(UIWebView *)webView
{
    self.actIV = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
    self.actIV.frame = CGRectMake(0, 0, 32, 32);
    //设置中心位置
    self.actIV.center = self.loadingView.center;
    [self.loadingView addSubview:self.actIV];
    
    [self.actIV startAnimating];
    [_actIV release];
    
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    
    [self.actIV stopAnimating];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    [self.loadingView removeFromSuperview];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
